﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Media;

namespace VRacer
{
    public partial class PlayerBase
    {
        protected static Queue<Color> _playerColors = new Queue<Color>(11);
        protected static int _count = 0;

        static PlayerBase()
        {
            Reset();
        }

        public static void Reset()
        {
            _playerColors.Clear();

            _playerColors.Enqueue(Colors.Green);
            _playerColors.Enqueue(Colors.BlueViolet);
            _playerColors.Enqueue(Colors.Brown);
            _playerColors.Enqueue(Colors.Chocolate);
            _playerColors.Enqueue(Colors.Crimson);
            _playerColors.Enqueue(Colors.DeepPink);
            _playerColors.Enqueue(Colors.GreenYellow);
            _playerColors.Enqueue(Colors.Yellow);
            _playerColors.Enqueue(Colors.Red);
        }

        public static string GetName()
        {
            return GetName("Player");
        }

        public static string GetName(string prefix)
        {
            return prefix + " " + ++_count;
        }

        public static Color GetColor(PlayerBase player)
        {
            if (_playerColors.Count > 0)
                return _playerColors.Dequeue();
            else
                return Colors.Black;
        }

    }
}
